package code.example.zookeeper.base.command.write;

import code.example.zookeeper.ZookeeperHolder;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Create   {
    Logger logger = LoggerFactory.getLogger(Create.class);
    ZookeeperHolder holder = null;
    public Create(ZookeeperHolder holder){
        this.holder = holder;
    }
    public String  createPath(String path) throws  Exception {
       String realPath  =   this.holder.getInstance().create(path,null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
       logger.info("[create][result]:"+realPath);
       return realPath;
    }

    public static void main(String args){

    }
}
